<?php
/** Unit_patient_location
	* 
	* @package Pharmacy Intervention 
	* @subpackage Controller
	* @category Main Screen 
	* @author Ray Nowell 
	*/  
class Welcome extends Controller {

	function Welcome()
	{
		parent::Controller();	
	}
	
	function _get_doc_ready_functions()
	{
			$ret_val	=	'$(".grid tr").bind("mouseenter mouseleave", function() {
							$(this).toggleClass("over");
							});';		
			return $ret_val;
	}
	
	function index()
	{		

	  
		$data['additional_javascript_doc_ready_functions'] = $this->_get_doc_ready_functions();
	  
		$data['title'] = "Principle Pharmacy -- Main";
		$data['heading'] = "Interventions";
		
		$data['view'] = 'welcome_message';
		$this->load->vars($data);
		$this->load->view('master_view', $data);	
		
	}
	
	/*
	 * Administrative Function that allows the administrator to change facilities
	 */
	function change_facility()
	{		
			if (!$this->ion_auth->is_admin())
		{
			redirect('welcome');
			return;
		}
		
		$user = $this->ion_auth->get_user();
		$data = array('current_facility_id' => $this->uri->segment(3));
		$this->ion_auth->update_user($user->id, $data);
		
		redirect('welcome');
	}

}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */